<?php


namespace App\Http\Controllers;


use App\Models\RoleScope;

class RoleScopeController extends Controller
{

    /*
     * @api get /admin-api/a/roles 角色列表
     * @version 0.0.1
     * @group admin
     *
     * @response 200 正常结果 {
     *  "code":0,
     *  "msg":"",
     *  "data":{}
     * }
     */
    public function getRole()
    {
        $roles = RoleScope::getAllRoles();
        return $this->sendSuccessJson($roles);
    }

    /*
     * @api get /admin-api/a/scopes 权限列表
     * @version 0.0.1
     * @group admin
     *
     * @response 200 正常结果 {
     *  "code":0,
     *  "msg":"",
     *  "data":{}
     * }
     */
    public function getScope()
    {
        $scope = RoleScope::getValidScopes();
        return $this->sendSuccessJson($scope);
    }
}